package com.company.eos.common;

/**
 * HTTP Restful Api 错误枚举
 *
 * @author Song, Wei
 * Date: 2022/3/17 17:57
 */
public enum ErrorEnum {

    /**
     * 错误
     */
    UNKNOWN_ERROR(400001, "未知错误，请联系管理员"),
    SERVER_ERROR(400002, "服务器发生错误，请稍后再试"),
    REQUEST_PARAM_ERROR(400003, "请求参数不能为空"),
    USER_PASSWORD_ERROR(400004, "密码错误"),
    LOGIN_INPUT_EMPTY_ERROR(400005, "登录账户或密码为空，请重新输入"),
    PASSWORD_INCORRECT_ERROR(400006, "登录账户或密码错误，请重新输入"),
    TOKEN_GENERATOR_ERROR(400007, "Token生成失败"),
    ACCOUNT_SHOULD_BE_EMAIL(400008, "暂时只支持邮箱找回"),
    PASSWORD_NOT_CONSISTENT(400009, "两次输入的密码不一致"),
    VERIFY_INCORRECT(400010, "您输入的验证码不正确"),
    AVATAR_UPLOAD_ERROR(400011, "上传头像失败！服务器发生异常"),
    TOKEN_EXPIRED_ERROR(400012, "没有验证消息或Token失效"),
    LOGIN_EXPIRED_ERROR(400013, "登录失效，请重新登录后尝试"),
    UPDATE_PASSWORD_ERROR(400014, "修改失败，请重新尝试"),

    /**
     * 数据库错误
     */
    DATA_ALREADY_EXIST(400050, "数据库中已存在该数据"),

    /**
     * NPE
     */
    USER_NOT_EXIST(400150, "用户不存在"),
    UPLOAD_AVATAR_NOT_EXIST(400151, "您还没有添加图片"),
    UPLOAD_AVATAR_FILE_NOT_CORRECT(400152, "文件格式错误，请重新选择"),
    UPDATE_PASSWORD_INPUT_ERROR(400153, "更新密码的输入有误"),
    USER_ID_NULL_ERROR(400154, "用户ID为空错误"),
    SALARY_ID_NULL_ERROR(400155, "薪资ID为空错误"),
    INPUT_NULL_ERROR(400156, "输入不能为空"),
    LOGIN_ACCOUNT_NOT_EXIST(400157, "账户不存在"),
    SALARY_INFO_NOT_EXIST(400158, "薪资信息不存在"),
    COMPANY_INFO_NOT_EXIST(400159, "公司信息不存在"),
    COMPANY_NOT_EXIST(400160, "公司不存在"),
    DEPARTMENT_NOT_EXIST(400161, "部门不存在"),
    VERIFY_NOT_EXIST(400162, "验证码已过期或未获取验证码"),
    EMAIL_NOT_EXIST(400163, "找不到该邮箱，请检查您的输入或联系管理员"),
    AVATAR_FILE_NULL_ERROR(400164, "头像文件为空，请重新选择文件上传"),
    SELECT_ERROR(400165, "您的选择有误，请重新选择"),
    POST_NULL_ERROR(400167, "职位不存在，请重新选择"),

    /**
     * 其他错误
     */
    ILLEGAL_CHARACTERS(400300, "非法字符，请重试"),

    ;

    /**
     * 错误码
     */
    private final Integer code;

    /**
     * 错误信息
     */
    private final String message;

    ErrorEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
